package com.ddwl.schema.bo.user;

import com.ddwl.schema.bo.base.BaseBo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author Fu Zhaohui
 * @version 1.0.0
 * @date 2019/4/30 14:48
 */
@ApiModel(description = "登录Bo")
@Setter
@Getter
public class RegBo extends BaseBo {

    @NotNull(message = "手机号码为空")
    @ApiModelProperty("手机号码")
    @Pattern(regexp = "^(\\s{0})|(1\\d{10})$", message = "手机号码格式错误")
    private String mobile;
    @NotNull(message = "手机验证码为空")
    @ApiModelProperty("手机验证码")
    private String code;
    @NotNull(message = "密码为空")
    @ApiModelProperty("登录密码")
    @Length(min = 6, message = "密码长度至少6位")
    private String password;
}
